package com.aeon.parameterized.runners;

import java.util.Arrays;
import java.util.Collection;

import junit.framework.JUnit4TestAdapter;

import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import com.aeon.app.Calculator;

@RunWith(Parameterized.class)
public class CalculatorTest {

	private double mExpected;
	private double mA;
	private double mB;

	@Parameters
	public static Collection getData() {
		return Arrays.asList(new Double[][] { { 4., 1., 3. }, { 5., 1., 4. } });
	}

	public CalculatorTest(double mExpected, double mA, double mB) {
		this.mExpected = mExpected;
		this.mA = mA;
		this.mB = mB;
	}

	@Test
	public void testAdd() {

		Calculator calculator = new Calculator();
		assertEquals(mExpected, calculator.add(mA, mB), 0);

	}
	// public static junit.framework.Test suite() {
	// return new JUnit4TestAdapter(CalculatorTest.class);
	// }

}
